1. Field of the Invention
The present invention relates to an encoding rate controlling apparatus which controls an encoding rate when using a predetermined quantization scale code and then quantizing information and further encoding it, and an information encoding apparatus including the encoding rate controlling apparatus, and more particularly relates to an encoding rate controlling apparatus for controlling the encoding rate when carrying out the encoding while making the encoding rate variable, and an information encoding apparatus including the encoding rate controlling apparatus.
2. Description of the Related Art
There are various encoding methods for encoding information, especially, digital information and then recording it onto a record medium or transmitting it through a broadcast wave, for example. An MPEG method is one of them, which is used to record a dynamic image onto a DVD (i.e., an optical disk that increases a record capacity to about seven times that of a conventional CD (Compact Disk)) that has been recently put into a practical use.
Here, the MPEG method is an encoding technique which can compress image information originally having a large amount of information at a high efficiency by variable-length-encoding the information, which is obtained by performing a DCT (Discrete Cosine Transform) with respect to a difference between an image to be encoded and a reference image located on a time axis before or behind the image to be encoded and quantizing it, and a difference of moving vectors (each implying a vector indicative of a direction and an amount in a movement if there is any movement between the reference image and the image to be encoded) by a unit of a macro block (implying a square pixel block including pixels of 16 pixelsxc3x9716 pixels in the image), and then transmitting or recording it.
By the way, when a simple image and a complex image are all compressed under the same compression rate at a time of compressing the images, for example, if it is the complex image, the excessive compression causes the image after the compression to be deteriorated.
Therefore, the MPEG method is constructed so as to use a so-called variable rate encoding manner and then make a compression rate variable for each image (namely, make an encoding rate variable) and accordingly carry out the encoding operation.
On the other hand, as a compression method using the variable rate encoding manner in the MPEG method, there are a manner referred to as a so-called two-times variable rate encoding manner and a manner referred to as a one-time variable rate encoding manner.
Here, the two-times variable rate encoding manner is the method of estimating a data generation amount (in other words, its quantization scale code) after respective encoding operations over all images to be encoded one time, and accurately controlling the encoding rate and the quantization scale code of each frame image at a second process, in accordance with the estimated data generation amount, and then carrying out the compression encoding optimal for the complexity of each image.
This two-times variable rate encoding manner can obtain the data generation amount in advance. Thus, if an image is compressed and encoded to a predetermined data amount, the optimal encoding rate and quantization scale code can be always calculated to thereby compress and encode to an image having a high image quality.
On the other hand, at first, the one-time variable rate encoding manner tentatively establishes an original quantization scale code of an image by using a predetermined method, and then starts the operations of quantizing and encoding the image by using the tentatively-established quantization scale code. Then, this manner sequentially calculates the average value of the encoding rate changed on the basis of the data generation amounts after the encoding of the respective images generated after the start of the operations (at this stage, even if the data generation amount of the image is changed, since the corresponding quantization scale code is constant, the corresponding encoding rate is also changed), and then compares this average value with a predetermined threshold. If the average value is greater, this manner determines that the data generation amount is excessive, and thereby increases the quantization scale code, and accordingly controls so as to reduce the average value. On the other hand, if the average value is smaller, it determines that the data generation amount is too small, and thereby decreases the quantization scale code, and accordingly carries out a process of increasing the average value.
This one-time variable rate encoding manner can compress and encode an input image to be encoded in a real time (namely, the input image can be compressed and encoded in an input order in the real time without analyzing the input image a plurality of times).
However, the above mentioned two-times variable rate encoding manner needs to analyze in advance the respective images to be encoded one time. This results in a problem that it is not suitable for the compression and the encoding in the real time.
On the other hand, the one-time variable rate encoding manner has the following problem. That is, the image quality is extremely dropped if a value of a quantization scale code tentatively established at an initial time of starting the compression and the encoding does not agree with a performance of an actual image although the compression and the encoding are possible in the real time (for example, in a series of images to be encoded, although there is not a substantial movement within the image in the vicinity of the lead thereof, if the movement within the image is suddenly increased by a scene change and the like).
The present invention is proposed in view of the above mentioned problems. It is therefore an object of the present invention to provide an encoding rate controlling apparatus which can restrict a deterioration of an information quality even if an encoding is carried out in a real time, and an information encoding apparatus having such an encoding rate controlling apparatus.
The above object of the present invention can be achieved by a first encoding rate controlling apparatus for controlling an encoding rate when quantizing and encoding dynamic image information composed of a dynamic image. The first encoding rate controlling apparatus is provided with a controlling device such as a rate controller etc., for performing a control for the encoding rate by changing a quantization scale code for quantizing the dynamic image information, and for converging an average value of the encoding rate through all of the dynamic image information to an average value corresponding to a predetermined average value. The controlling device establishes on a time axis a plurality of change timings, each of which is a timing when the quantization scale code is changed, calculates the average value of the encoding rate corresponding to each of the established change timings, and performs the control for the encoding rate on the basis of the calculated average value.
According to the first encoding rate controlling apparatus of the present invention, since the control for the encoding rate is performed on the basis of the average value of the encoding rate for each of the change timings, it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value. Thus, it is possible to encode the dynamic image information while restricting or minimizing a deterioration of an information quality.
Therefore, even if the dynamic image information is encoded in a real time, it is still possible to encode it while restricting or minimizing the deterioration of the information quality.
In one aspect of the first encoding rate controlling apparatus of the present invention, the controlling device is provided with: a judging device such as a CPU etc., for dividing in advance a value, which the encoding rate can take for each of the established change timings, into a plurality of rate ranges, and judging one of the rate ranges to which the average value of the encoding rate belongs; and a changing device such as a CPU etc., for changing the quantization scale code in correspondence with the judged one of the rate ranges, so as to perform the control for the encoding rate.
According to this aspect, since one of the rate ranges to which the average value belongs is judged and the quantization scale code is changed on the basis of this judgment result, it is possible to surely converge the encoding rate to the average value within the range corresponding to the predetermined average value by employing a relatively simple configuration.
In this aspect, each line, which connects boundary values of the rate ranges for each of the established change timings, for corresponding each of the boundary values may be a curve converged to the predetermined average value.
By constructing in this manner, it is possible to perform the control for the encoding rate while preventing the encoding rate from being drastically changed.
In another aspect of the first encoding rate controlling apparatus of the present invention, the average value of the encoding rate is an average value from a start time point of encoding the dynamic image information until a current time point of the change timing.
According to this aspect, since the encoding rate is controlled by using the average value of the encoding rate from the start time point of encoding the dynamic image information until the current time point of the change timing, it is possible to more surely converge the encoding rate to the average value corresponding to the predetermined average value.
In another aspect of the first encoding rate controlling apparatus of the present invention, the change timings are established at a dense time interval in a former stage and a latter stage of the dynamic image information and are established at a sparse time interval in a middle stage of the dynamic image information which is between the former stage and the latter stage.
According to this aspect, it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value while reducing a processing load at the time of controlling.
In another aspect of the first encoding rate controlling apparatus of the present invention, the controlling device changes the quantization scale code on the basis of an encoding rate difference, which is a difference between the encoding rates in two of the change timings adjacent to each other.
According to this aspect, since the quantization scale code is changed to be set on the basis of the encoding rate difference at the two change timings, an unnecessary change of the quantization scale code can be avoided and it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value.
The above object of the present invention can be also achieved by a second encoding rate controlling apparatus for controlling an encoding rate when quantizing and encoding dynamic image information composed of a dynamic image. The second encoding rate controlling apparatus is provided with: a first controlling device such as a first controller etc., for performing a first control for the encoding rate when encoding former information, which is the dynamic image information inputted between a start time point of an input of the dynamic image information to be encoded and a predetermined first time point; and a second controlling device such as a second controller etc., for performing a second control, which is different from the first control, for the encoding rate when encoding later information, which is the dynamic image information inputted after the former information, on the basis of a result of the first control, and for converging an average value of the encoding rate through all of the dynamic image information to an average value corresponding to a predetermined average value.
According to the second encoding rate controlling apparatus of the present invention, since the encoding rate as for encoding one dynamic image information is finally converged to the average value corresponding to the predetermined average value by the double stage control i.e., the first control for the former information and the second control for the later information, it is possible to encode the dynamic information while restricting or minimizing a deterioration of an information quality.
Therefore, even if the dynamic image information is encoded in a real time, it is still possible to encode it while restricting or minimizing the deterioration of the information quality.
In one aspect of the second encoding rate controlling apparatus of the present invention, the first controlling device and the second controlling device control the encoding rate while changing a generation encoding amount by changing a quantization scale code when respectively quantizing the former information and the later information.
According to this aspect, it is possible to efficiently control the encoding rate.
In this aspect, a plurality of change timings, each of which is a timing when the quantization scale code is changed, may be established on a time axis. The first controlling device may calculate a first average value of the encoding rate between a current change timing, which is one of the change timings at present time, and an immediately-before change timing, which is one of the change timings immediately before the current change timing, and may perform the first control on the basis of the first average value. The second controlling device may calculate a second average value of the encoding rate from a start time point of encoding the dynamic image information until the current change timing, and may perform the second control on the basis of the second average value.
By constructing in this manner, since the control is performed by using the first average value at the time of the first control and is performed by using the second average value at the time of the second control, it is possible to control the encoding rate by using a relatively simple process at the time of the first control and it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value by the second control.
In this case, the first controlling device may be provided with: a first judging device such as a CPU etc., for dividing in advance a value, which the encoding rate can take for each of the established change timings, into a plurality of first rate ranges, and judging one of the first rate ranges to which the first average value belongs; and a first changing device such as a CPU etc., for changing the quantization scale code in correspondence with the judged one of the first rate ranges, so as to perform the first control. The second controlling device may be provided with: a second judging device such as a CPU etc., for dividing in advance a value, which the encoding rate can take for each of the established change timings, into a plurality of second rate ranges different from the first rate ranges, and judging one of the second rate ranges to which the second average value belongs; and a second changing device such as a CPU etc., for changing the quantization scale code in correspondence with the judged one of the second rate ranges, so as to perform the second control.
By constructing in this manner, since one of the second rate rage to which the second average value belongs is judged from the second rate ranges different from the first rate ranges used for the first control and the quantization scale code is changed on the basis of this judgment result, it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value by changing the quantization scale code by using the rate ranges different for each control.
In this case further, each line, which connects boundary values of the first rate ranges for each of the established change timings, for corresponding each of the boundary values may be a straight line, and each line, which connects boundary values of the second rate ranges for each of the established change timings, for corresponding each of the boundary values may be a curve converged to the predetermined average value.
By constructing in this manner, it is possible to perform the first control by using a relatively simple process, and it is possible to perform the second control while preventing the encoding rate from being drastically changed.
Alternatively, in the above mentioned case that a plurality of change timings are established, the change timings corresponding to the former information may be established at a constant time interval, and the change timings corresponding to the later information may be established at a dense time interval in a former stage and a latter stage of the later information and are established at a sparse time interval in a middle stage of the later information, which is between the former stage and the latter stage.
By constructing in this manner, it is possible to control the encoding rate by using a relatively simple process at the time of the first control, and it is possible to surely converge the encoding rate to the average value corresponding to the predetermined average value while reducing a processing load at the time of the second control.
Alternatively, in the above mentioned one aspect in which the first and second controlling device control while changing the generation encoding amount, the second controlling device may perform the second control such that a value of the quantization scale code is changed to be within a range between a minimum and a maximum of the quantization scale code which are set in advance.
By constructing in this manner, since the value of the quantization scale code is changed to be within the range between the minimum and the maximum of the quantization scale code set in advance, it is possible to more appropriately control the encoding rate.
In another aspect of the second encoding rate controlling apparatus of the present invention, the first controlling device and the second controlling device perform the first control and the second control respectively such that the encoding rate is changed to be within a range not exceeding a maximum value of the encoding rate set in advance.
According to this aspect, such a problem that an encoding process exceeding a transfer speed (i.e., a recording speed) onto a record medium, for example, since the encoding rate exceeds the maximum value thereof can be prevented.
In another aspect of the second encoding rate controlling apparatus of the present invention, the dynamic image information is encoded while evaluating an accumulated information amount in a memory which is used for decoding the encoded dynamic image information.
According to this aspect, since the encoding process is performed while the accumulated information amount in the memory used for decoding is evaluated, it is possible to prevent the memory from being over-flown or under-flown at the time of decoding the dynamic image information, and it is possible to perform an encoding process which allows a stable decoding process.
The above object of the present invention can be also achieved by an information encoding apparatus provided with (i) the above described first or second encoding rate controlling apparatus of the present invention, (ii) a quantizing device such as a quantization unit etc., for quantizing the dynamic image information by using the changed quantization scale code, and (iii) an encoding device such as a variable length encoder etc., for variable-length-encoding the quantized dynamic image information.
According to the information encoding apparatus of the present invention, by converging the encoding rate sequentially to the average value corresponding to the predetermined average value, it is possible to encode the dynamic image information while restricting or minimizing a deterioration of an information quality.
In one aspect of the information encoding apparatus of the present invention, the encoding device performs a compression-encoding process based on an MPEG 2 (Moving Picture Expert Group 2) method with respect to the dynamic image information by using the encoding rate.
According to this aspect, it is possible to compress and encode the dynamic image information while restricting or minimizing a deterioration of an information quality.
The nature, utility, and further features of this invention will be more clearly apparent from the following detailed description with respect to preferred embodiments of the invention when read in conjunction with the accompanying drawings briefly described below.